*REPLICATION CODE FOR "WHO CARES: EXPLAINING PERCEPTIONS OF COMPASSION IN CANDIDATES FOR OFFICE"
*AUTHOR: JARED MCDONALD
*JOURNAL: POLITICAL BEHAVIOR

**Experiential Empathy**

use "mcdonald_experiential.dta"

*NOTE: For all analyses in this dataset, apply weight variable - "weight"

*Figure 1, Table A1 - Treatment Effect on Perceptions of Caring
*NOTE: Anti-partisan indicates 1=opposite partisanship, 0=same partisanship

reg allencaresstand allensympathy allenempathy [pw=weight] if compobs==1
bysort antipartisan: reg allencaresstand allensympathy allenempathy [pw=weight] if pidwleaners~=2 & compobs==1
bysort antipartisan: reg allencaresstand allencontrol allenempathy [pw=weight] if pidwleaners~=2 & compobs==1
reg allencaresstand allenempathy antipartisan antipartisanXempathy [pw=weight] if pidwleaners~=2 & compobs==1 & allencontrol~=1

*Figure 2, Table A1 - Treatment Effect on Favorability

reg allenfavstand allensympathy allenempathy [pw=weight] if compobs==1
bysort antipartisan: reg allenfavstand allensympathy allenempathy [pw=weight] if pidwleaners~=2 & compobs==1
bysort antipartisan: reg allenfavstand allencontrol allenempathy [pw=weight] if pidwleaners~=2 & compobs==1
reg allenfavstand allenempathy antipartisan antipartisanXempathy [pw=weight] if pidwleaners~=2 & compobs==1 & allencontrol~=1

*Table 1 - Allen Knowledgeable
bysort antipartisan: reg allenknowstand allencontrol allensympathy allenempathy [pw=weight] if pidwleaners~=2 & compobs==1, nocons
bysort antipartisan: reg allenknowstand allencontrol allenempathy [pw=weight] if pidwleaners~=2 & compobs==1
reg allenknowstand allencontrol allensympathy allenempathy [pw=weight] if compobs==1, nocons
reg allenknowstand allencontrol allenempathy [pw=weight] if compobs==1

*Table A2: Repeated Measures - using sympathy as baseline
xtmixed traitvalue allenempathy##compobs allensympathy##compobs [pw=weight] || id:, var
bysort antipartisan: xtmixed traitvalue allenempathy##compobs allensympathy##compobs [pw=weight] if pidwleaners~=2 || id:, var

*Table A3: Repeated Measures - using sympathy as baseline
xtmixed traitvalue allencontrol##compobs allenempathy##compobs [pw=weight] || id:, var
bysort antipartisan: xtmixed traitvalue allencontrol##compobs allenempathy##compobs [pw=weight] if pidwleaners~=2 || id:, var

*Table A4: Randomization Check
mlogit allenconditions age male white educ faminc ideo7 pid7 [pw=weight] if compobs==1

**Emotional Empathy**

use "mcdonald_emotion.dta"

*Figure 3, Table A5: Effect of emotional resonance for the full sample
bysort hopevsanger: reg allencaresstand emotionalresonance if compobs==1
reg allencaresstand angrycand if emotionalresonance==. & compobs==1
bysort hopevsanger: reg allenfavstand emotionalresonance if compobs==1
reg allenfavstand angrycand if emotionalresonance==. & compobs==1

*Table 2: Effect of Emotional resonance on copartisans and outpartisans
bysort copartisan: reg allencaresstand emotionalresonance if compobs==1
bysort copartisan: reg allenfavstand emotionalresonance if compobs==1

*Table A6: Repeated Measures

xtmixed traitvalue emotionalresonance##compobs || id:, var

*Table A7. Randomization Check

logit angrycand age male white faminc pid7

**Identity-Based Empathy**

use "mcdonald_identity.dta"

*Figures 4-5, Table A8: Effect of co-racial candidate on perceptions of compassion
reg allencaresstand coracial if binrace!=.
bysort binrace: reg allencaresstand whitecand if pid3==1
bysort binrace: reg allencaresstand whitecand if pid3==3

*Figures 6-7, Table A9: Effect of co-racial candidate on favorability
reg allenfavstand coracial if binrace!=.
bysort binrace: reg allenfavstand whitecand if pid3==1
bysort binrace: reg allenfavstand whitecand if pid3==3

*Table A10: Interactive effect of ideology and race-of-candidate among whites
reg allencaresstand whitecand libcon7 whitecandXideo if pid3==1 & binrace==0

*Table A11: Randomization Check

bysort white: logit coracial age male faminc pid7
